package com.hzdl.flower.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.flower.bean.Log;
import com.hzdl.flower.bean.Order;
import com.hzdl.flower.mapper.AorderMapper;
import com.hzdl.flower.service.AorderService;
import com.hzdl.flower.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AorderServiceImpl implements AorderService {
    @Autowired
    private AorderMapper am;


    @Override
    public PageInfo<Order> findOrder(OrderVo orderVo) {
        PageHelper.startPage(orderVo.getPage(), orderVo.getLimit());
        List<Order> orders = am.findOrder(orderVo);
        PageInfo pageInfo = new PageInfo(orders);
        return pageInfo;
    }

    @Override
    public int deleteById(Integer id) {
        return am.deleteById(id);
    }

    @Override
    public Order findById(Integer id) {
        return am.findById(id);
    }
}
